Skip to content

/osm dual basemap: OSM map ↔ ESRI satellite toggle#101

Merged
AdaWorldAPI merged 2 commits into
mainfrom
claude/osm-dual-basemap
Jul 10, 2026
Merged

/osm dual basemap: OSM map ↔ ESRI satellite toggle#101
AdaWorldAPI merged 2 commits into
mainfrom
claude/osm-dual-basemap

Conversation

@AdaWorldAPI

@AdaWorldAPI AdaWorldAPI commented Jul 10, 2026

Copy link
Copy Markdown
Owner

The /osm slippy cockpit can now switch skins: OSM raster ↔ ESRI World Imagery satellite — the same keyless imagery source the ver-9 terrain skins (canyon/havel) drape from, so the flat map and the 3D scenes share one imagery truth. Same slippy addresses, same HHTL keys — two skins of one cascade.

What changed

crates/cockpit-server/src/osm_tiles.rs

  • SAT_TILE_URL + sat_tile_url() — ESRI's path is z/y/x (row before column), unlike OSM's z/x/y; a shared fill_template carries the axis order in the template so both fill through one call.
  • /api/osm/locate and /api/osm/tile/:z/:x/:y now report sat_tile_url + sat_source alongside the OSM fields (additive JSON, non-breaking).
  • New test pins the y-before-x swap (the classic ESRI trap).

crates/cockpit-server/src/osm.rs (the inline page)

  • BASEMAPS table (src template, attribution, next), a sat/osm toggle button in the map controls (names the skin you'll switch TO), attribution follows the active source (OSM contributors ↔ Esri, Maxar, Earthstar Geographics).

Verification

  • Headless on the extracted page HTML: OSM→sat→OSM round trip; tile srcs swap with the axis order correct (12/2197/134012/1340/2197); attribution swaps.
  • cockpit-server cannot compile in this container (rusty_v8 static-lib download blocked by org egress policy) — the Rust side mirrors the existing tested handler pattern; CI runs the new test.

Follow-ups still queued

  • Release-hosted on-demand terrain assets (get the 36–73 MB gz blobs out of git)
  • z15 canyon re-fetch (~20M real detail → LOD ~5M)
  • Sentinel-2 skin swap (GrandCanyon_S2_20260620.tif)
  • React Add cargo xtask create-worktree quarto-dev/q2#185 on the branch Railway — not yet reproduced in headless sweeps (desktop/mobile, LOD/topo/features/pick); needs the triggering route/interaction

🤖 Generated with Claude Code


Generated by Claude Code

Summary by CodeRabbit

  • New Features

    • Added a basemap toggle to the /osm cockpit, allowing users to switch between OpenStreetMap and ESRI World Imagery satellite views.
    • Tile imagery and source attribution now update automatically when switching basemaps.
    • Location and tile metadata responses now include satellite imagery information.
  • Tests

    • Added coverage verifying correct satellite tile addressing.

The /osm slippy cockpit can now switch skins: OSM raster tiles <-> ESRI
World Imagery satellite — the SAME keyless imagery source the ver-9
terrain skins (canyon/havel) drape from, so the flat map and the 3D
scenes share one imagery truth. Same slippy addresses, same HHTL keys —
two skins of one cascade.

osm_tiles.rs: SAT_TILE_URL const + sat_tile_url() — ESRI's path is
z/y/x (row before column), unlike OSM's z/x/y; a shared fill_template
carries the axis order in the template so both fill through one call.
The /api/osm/locate and /api/osm/tile/:z/:x/:y responses now report
sat_tile_url + sat_source alongside the OSM fields (additive, non-
breaking). New test pins the y-before-x swap.

osm.rs (the inline page): a BASEMAPS table (src template, attribution,
next), a `sat`/`osm` toggle in the map controls (button names the skin
you will switch TO), attribution follows the active source (OSM
contributors <-> Esri, Maxar, Earthstar Geographics).

Verified headless on the extracted page HTML: OSM->sat->OSM round trip,
tile srcs swap with the z/y/x order correct (12/2197/1340 <->
12/1340/2197), attribution swaps. cockpit-server itself cannot compile
in this container (rusty_v8 static-lib download blocked by org egress
policy); the Rust side mirrors the existing tested handler pattern and
CI runs the new test.

Co-Authored-By: Claude Opus 4.8 <[email protected]>
Claude-Session: https://claude.ai/code/session_012jEwwaT5JZ5x8qWvcnaMYC
@cursor

cursor Bot commented Jul 10, 2026

Copy link
Copy Markdown

Bugbot couldn't run - usage limit reached

Bugbot is counted against Cursor usage for this user or team, and this run hit a usage or spend limit.

A user or team admin can review and increase usage limits in the Cursor dashboard.

(requestId: serverGenReqId_2f5bf1a2-f2d8-4242-94fa-30ec44be8789)

@coderabbitai

coderabbitai Bot commented Jul 10, 2026

Copy link
Copy Markdown

Review Change Stack

Warning

Review limit reached

@AdaWorldAPI, you've reached your PR review limit, so we couldn't start this review.

Next review available in: 49 minutes

Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available.
You're only billed for reviews past your plan's rate limits ($0.25/file).

How can I continue?

After more reviews become available, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews.

How do review limits work?

CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability.

For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window.

Please refer docs for additional details.

Review details
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro Plus

Run ID: 26b8717b-e4dc-47d5-af5a-02ad7dbcff6f

📥 Commits

Reviewing files that changed from the base of the PR and between 173f6f7 and 16c9154.

📒 Files selected for processing (1)
  • crates/cockpit-server/src/osm.rs
📝 Walkthrough

Walkthrough

The /osm cockpit now toggles between OpenStreetMap and ESRI World Imagery basemaps. Server responses expose satellite tile metadata using ESRI z/y/x addressing, while the page updates tile URLs, labels, and attribution.

Changes

OSM dual basemap

Layer / File(s) Summary
Satellite tile metadata and addressing
crates/cockpit-server/src/osm_tiles.rs
Adds ESRI satellite URL generation, includes satellite fields in locate and metadata JSON, and tests z/y/x axis ordering.
Cockpit basemap toggle
crates/cockpit-server/src/osm.rs, claude-notes/plans/...
Adds OSM and satellite basemap definitions, toggle behavior, dynamic attribution, tile rerendering, and shipped verification notes.

Estimated code review effort: 2 (Simple) | ~10 minutes

Possibly related PRs

  • AdaWorldAPI/q2#73: Earlier OSM tile routes and metadata are extended here with ESRI satellite support.

Poem

I’m a rabbit hopping over the map,
From OSM streets to satellite’s cap.
Z, Y, X tiles fall in line,
Attributions change, the views now shine.
Toggle twice—what a clever hop! 🐇

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title accurately summarizes the main change: adding a dual basemap toggle for /osm between OSM and ESRI satellite.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@crates/cockpit-server/src/osm.rs`:
- Around line 140-146: Update the click→locate handler to select the tile URL
matching the active basemap: use d.sat_tile_url when basemap is satellite and
d.tile_url otherwise, then display that value in the tile source panel instead
of always using d.tile_url.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro Plus

Run ID: 47bd8ac8-fcbd-4958-8ecc-c1e78a70a1b6

📥 Commits

Reviewing files that changed from the base of the PR and between 2112136 and 173f6f7.

📒 Files selected for processing (3)
  • claude-notes/plans/2026-07-10-garmin-dem-satellite-skin.md
  • crates/cockpit-server/src/osm.rs
  • crates/cockpit-server/src/osm_tiles.rs

Comment thread crates/cockpit-server/src/osm.rs
CodeRabbit finding on #101: the click->locate panel always displayed
d.tile_url, so on the satellite basemap it showed the OSM URL — a
mismatch with the visible tiles. Select d.sat_tile_url when the sat
skin is active (the locate API already reports both).

Verified headless with a stubbed locate API: click on OSM shows the
openstreetmap URL, toggle to sat + click shows the arcgisonline URL.

Co-Authored-By: Claude Opus 4.8 <[email protected]>
Claude-Session: https://claude.ai/code/session_012jEwwaT5JZ5x8qWvcnaMYC
@AdaWorldAPI AdaWorldAPI merged commit 343d2f0 into main Jul 10, 2026
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants